<template>
    <div class="checkout-checkout">
        <div class="layui-layer-title" style="cursor: move;">地址列表</div>
        <span class="layui-layer-setwin">
            <a class="layui-layer-ico layui-layer-close layui-layer-close1" href="#/account"></a></span>

        <div class="quick-checkout-wrapper">

            <div class="checkout-section" id="shipping-address-section">

                <div id="shipping-existing">
                    <ul>
                        <li class=" block" v-for="item in list"
                            v-bind:class="{'active':item.is_default==1}">
                            <div class="item" >
                                <i class="fa fa-map-marker" aria-hidden="true"></i>
                                {{item.name}} ({{item.telephone}})<br>
                                {{item.province_name}} {{item.city_name}} {{item.area_name}}<br>
                                {{item.detail_address}}
                            </div>
                            <div class="address-action">
                                <a v-bind:href="'#/account/address-edit/' + item.id" class="edit" ><i class="iconfont"></i></a>
                            </div>
                        </li>
                        <li class=" block" >
                            <a class="btn btn-primary btn-block" href="#/address-edit">添加新地址</a>
                        </li>
                    </ul>
                </div>

            </div>
        </div>
    </div>
</template>

<script>
    export default {
        // name: "address",
        data:function(){
            return {
                list:[],
                id:'',
            }
        },

        methods:{

            get_list:function(){
                var url =  this.config.app_url + '&r=address.get_list';
                var t = this;
                this.axios.get( url ,{}).then(function( res ){
                    t.list = res.data;
                });
            }

        },

        created:function(){

            this.get_list();

        },



    }
</script>

<style scoped>

</style>